﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Framework.Common
{
    /// <summary>
    /// 表示调用api返回数据 
    /// </summary>
    [DataContract]
    public class DataResult
    {
        /// <summary>
        /// 交互编码
        /// </summary>
        [DataMember]
        public ResponseStatusCode Code { get; set; }
        /// <summary>
        /// 响应消息
        /// </summary>
        [DataMember]
        public string Msg { get; set; }
        /// <summary>
        /// 返回数据
        /// </summary>
        [DataMember]
        public object Data { get; set; }
        public DataResult()
        { }

        /// <summary>
        /// 初始化一个<see cref="DataResult"/>类型的新实例
        /// </summary>
        public DataResult(ResponseStatusCode code, string msg, object data = null)
        {
            this.Code = code;
            this.Msg = msg;
            this.Data = data;
        }

        
    }
}
